package com.howentech.pageObject;

import com.howentech.framework.BasePage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;



public class LoginPage extends BasePage {
    WebDriver driver;

    //用户输入框
    @FindBy(how = How.XPATH, xpath="//input[@class='el-input__inner' and @type='text']")
    WebElement username_input;
    //密码输入框
    @FindBy(how = How.XPATH, xpath="//input[@class='el-input__inner' and @type='password']")
    WebElement password_input;
    //登录按钮
    @FindBy(how = How.XPATH, xpath="//*[@id=\"app\"]/div/div[2]/div[2]/form/div[4]/div/button/span")
    WebElement login_button;


    public LoginPage(WebDriver driver) {
        super(driver);
        // TODO自动生成的构造函数存根
    }


    public void login(String username, String password) {
        username_input.sendKeys(username);
        password_input.sendKeys(password);
        login_button.click();
    }

}
